import time


from selenium import webdriver
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By

driver=webdriver.Edge()
driver.maximize_window()
driver.get('http://10.59.9.14:7003/')
time.sleep(2)

# 登录
driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
time.sleep(2)
driver.find_element(By.NAME,'username').send_keys('18986670716')
time.sleep(2)
driver.find_element(By.NAME,'password').send_keys('a123456')
time.sleep(15)
driver.find_element(By.CSS_SELECTOR,'.finish-btn').click()
time.sleep(5)
driver.find_element(By.XPATH,'/html/body/div[3]/div[2]/ul/li[1]/a').click()
time.sleep(2)

# 输入框
search=driver.find_element(By.CSS_SELECTOR,'.search-input')
search.send_keys('龙虾')
time.sleep(2)
search.send_keys(Keys.ENTER)
time.sleep(10)

driver.get('http://10.59.9.14:7003/')
module=driver.find_element(By.CLASS_NAME,'search-input')
module.send_keys('123456')
# 文本值
print(module.get_attribute('text'))
# 获取元素的具体属性值
print(module.get_attribute('class'))
# 获取元素的宽高
print(module.size)
# 获取元素的坐标值
print(module.location)
# 打印元素是否可用
print(module.is_enabled())
# 打印元素是否显示
print(module.is_displayed())
# 打印元素是否被选中
print(module.is_selected())

# print(module.get_attribute('text'))
# print(module.size)
# print(module.get_attribute('class'))
# print(module.location)
# print(module.is_enabled())
# print(module.is_displayed())
# print(module.is_selected())